{extend name="base/common"}

{block name="style"}
<script src="/static/ueditor/ueditor.config.js"></script>
<script src="/static/ueditor/ueditor.all.min.js"></script>
{/block}

{block name="page-header"}

{/block}

{block name="main"}
<!--<script id="container" name="content" type="text/plain">-->
        <!--开始使用-->
<!--</script>-->

<div class="controls">
    <label class="item-label">分类图标</label>
    <input type="file" id="upload_picture" class="upload_picture">
    <input type="hidden" name="icon" id="icon" value=""/>
    <div class="upload-img-box">
        <div class="upload-pre-item"><img src=""/></div>
    </div>
</div>
{/block}

{block name="script"}
<script src="/static/uploadify/jquery.uploadify.min.js"></script>
<script>
    //上传图片
    /* 初始化上传插件 */
    $(".upload_picture").uploadify({
        "height"          : 30,
        "swf"             : "/static/uploadify/uploadify.swf",
        "fileObjName"     : "picture",
        "buttonText"      : "上传图片",
        "uploader"        : "{:Url('File/uploadPicture')}",
        "width"           : 120,
        'removeTimeout'   : 1,
        'fileTypeExts'    : '*.jpg; *.png; *.gif;',
        "onUploadSuccess" : uploadPicture,
        'onFallback' : function() {
            alert('未检测到兼容版本的Flash.');
        }
    });
    function uploadPicture(file, data){
        console.log(data);
        alert(data);
    }
</script>
{/block}